from .models import *
from rest_framework import serializers

class HostCityModelSerializer(serializers.ModelSerializer):
    # 热门城市
    class Meta:
        model = City
        fields = '__all__'


class EnterpriseModelSerializer(serializers.ModelSerializer):
    '''企业'''
    class Meta:
        model = Enterprise
        fields = ('id', 'name', 'labels', 'logo', 'recruits', 'summary')
        # fields = '__all__'

class RecommendModelSerializer(serializers.ModelSerializer):
    # 推荐职位
    # enterprise = serializers.StringRelatedField()
    # enterprise_id = serializers.IntegerField()
    enterprise = EnterpriseModelSerializer()

    class Meta:
        model = Recruit
        fields = '__all__'


class EnterpriseModelSerializer1(serializers.ModelSerializer):
    '''企业'''
    # recruits = RecommendModelSerializer()

    class Meta:
        model = Enterprise
        fields = '__all__'